perl-script vs cgi-script
am 02.08.2010 03:21:20 von Roland Mai--0016364d22e5a5a5c6048ccd0480
Content-Type: text/plain; charset=ISO-8859-1
Hi,
I'm relatively new to perl so bear with me please. I'm seeing a strange
behavior with perl
When I use the following config in apache
ServerName perly
DocumentRoot /var/www/perl/perly
AddHandler perl-script .pl
PerlOptions ParseHeaders
PerlHandler ModPerl::Registry
PerlSendHeader On
Options Indexes ExecCGI
AllowOverride All
Order allow,deny
Allow from All
The following code
#!/usr/bin/perl -w
use strict;
use warnings;
use DBI;
use Cwd;
use CGI::Pretty qw(:standard);
my %config = (
host => 'localhost',
database => 'perly',
username => 'root',
password => ''
);
my $dbh = DBI->connect("dbi:mysql:".$config{'database'},
$config{'username'}, $config{'password'});
print header,
start_html(-title => 'Please Login',
-base => 'true',
-target => '_blank',
-meta => {'keywords' => 'login',
'description' => 'This is the login screen'},
-style => {'src'=>'/styles/style1.css'} );
require("/var/www/perl/perly/login.pl");
print end_html;
print "\n";
The login.pl file gets executed only once. Upon subsequent refreshes it
dissapears.
If I have AddHandler cgi-script .pl above, the script works fine.
Can someone please help me fix this issue?
Thanks,
Roland
--0016364d22e5a5a5c6048ccd0480
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,
I'm relatively new to perl so bear with me please. I'm s=
eeing a strange behavior with perl
When I use the following config i=
n apache
<VirtualHost *:80>
=A0 ServerName perly
=A0 Doc=
umentRoot /var/www/perl/perly
=A0 <Directory /var/www/perl/perly>
=A0 AddHandler perl-=
script .pl
=A0 PerlOptions ParseHeaders
=A0 PerlHandler M=
odPerl::Registry
=A0 PerlSendHeader On
=A0 Options Index=
es ExecCGI
=A0 AllowOverride All
=A0 Order allow,deny
=A0 Allow from All
=A0 </Director=
y>
</VirtualHost>
The following code
#!/usr/bin/perl =
-w
use strict;
use warnings;
use DBI;
use Cwd;
use CGI::Pret=
ty qw(:standard);
my %config =3D (
=A0 host =3D> 'localhost=
39;,
=A0 database =3D> 'perly',
=A0 username =
=3D> 'root',
=A0 password =3D> ''
);
<=
br>my $dbh =3D DBI->connect("dbi:mysql:".$config{'database=
'}, $config{'username'}, $config{'password'});
print header,
start_html(-title =3D>=A0 'Please Login=
39;,
=A0 -base =3D>=A0 'true&=
#39;,
=A0 -target =3D>=A0 '_blank=
39;,
=A0 -meta =3D>=A0 {'keyw=
ords' =3D>=A0 'login',
=
39;description'=A0 =3D>=A0 'This is the login screen'},
=
=A0 -style=A0 =3D>=A0 {'src'=3D>=
;'/styles/style1.css'} );
require("/var/www/perl/perly/
ref=3D"http://login.pl">login.pl");
print end_html;
print "\n";
The
..pl">login.pl file gets executed only once. Upon subsequent refreshes i=
t dissapears.
If I have AddHandler cgi-script .pl above, the script work=
s fine.
Can someone please help me fix this issue?
Thanks,
Roland=
--0016364d22e5a5a5c6048ccd0480--